profiling: Avoid criticals
authorMatthias Clasen <mclasen@redhat.com>
Fri, 21 Feb 2020 12:23:40 +0000 (07:23 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 21 Feb 2020 12:23:40 +0000 (07:23 -0500)
With events no longer GObjects, the type class is
longer around for peeking.

gdk/gdksurface.c

index 6974e7ec7636d03e6cc90d676132f3c0b07a471e..0d326e3dfdaf87d6f057f67c555377e9d490f59c 100644 (file)
@@ -4035,11 +4035,14 @@ add_event_mark (GdkEvent *event,
 {
   gchar *message = NULL;
   const gchar *kind;
+  GEnumClass *class;
   GEnumValue *value;
   GdkEventType event_type;
 
   event_type = gdk_event_get_event_type (event);
-  value = g_enum_get_value (g_type_class_peek_static (GDK_TYPE_EVENT_TYPE), event_type);
+  class = g_type_class_ref (GDK_TYPE_EVENT_TYPE);
+  value = g_enum_get_value (class, event_type);
+  g_type_class_unref (class);
   kind = value ? value->value_nick : NULL;
 
   switch (event_type)